<? if(!defined('IN_DISCUZ')) exit('Access Denied'); hookscriptoutput('portalcp_diy');?><? include template('common/header'); if($op=='blockclass') { ?>
<ul class="blocks content"><? if(is_array($_G['cache']['blockclass'])) foreach($_G['cache']['blockclass'] as $key => $value) { ?><li class="module-<?=$key?>">
<ul><? if(is_array($value['subs'])) foreach($value['subs'] as $skey => $svalue) { ?><li class="module-<?=$skey?>"><label onmousedown="drag.createObj (event,'block','<?=$skey?>');" onmouseover="className='hover';" onmouseout="this.className='';"><?=$svalue['name']?></label></li>
<? } ?>
</ul>
</li>
<? } ?>
</ul>
<? } elseif($op == 'style') { ?>
<ul class="content"><? if(is_array($themes)) foreach($themes as $value) { ?>  <li><a href="javascript:;" onclick="spaceDiy.changeStyle('<?=$value['dir']?>');return false;"><img src="<?=STATICURL?><?=$value['dir']?>/preview.jpg" /><?=$value['name']?></a></li>
<? } ?>
</ul>
<? } elseif($_GET['op'] == 'image') { ?>
<div id="diyimg_prev" class="z"><?=$multi?></div>
<ul id="imagebody"><? if(is_array($list)) foreach($list as $key => $value) { ?><li class="thumb"><a href="javascript:;" onclick="return false;"><img src="<?=$value['pic']?>" alt="" onclick="spaceDiy.setBgImage(this);"/></a></li>
<? } ?>
</ul>
<div id="diyimg_next" class="z"><?=$multi?></div>
<? } elseif($_GET['op'] == 'diy') { ?>
<dl class='diy'>
<dt class="cl pns">
<div class="y">
<button type="button" id="uploadmsg_button" onclick="Util.toggleEle('upload');" class="pn pnc z<? if(empty($list)) { ?> hide<? } ?>"><span>上传新图片</span></button>
<div id="upload" class="z<? if($list) { ?> hide<? } ?>"><iframe id="uploadframe" name="uploadframe" width="0" height="0" marginwidth="0" frameborder="0" src="about:blank"></iframe>
<form method="post" autocomplete="off" name="uploadpic" id="uploadpic" action="portal.php?mod=portalcp&amp;ac=diy" enctype="multipart/form-data" target="uploadframe" onsubmit="return spaceDiy.uploadSubmit();">
<input type="file" class="t_input" name="attach" size="15">
<input type="hidden" name="formhash" value="<?=FORMHASH?>" />
<input type="hidden" name="topicid" value="<?=$_GET['topicid']?>" />
<button type="submit" name="uploadsubmit" id="btnupload" class="pn" value="true"><span>开始上传</span></button>
</form>
</div>
<span id="uploadmsg" class="z"></span>
</div>
正在编辑: 
<a id="diy_tag_body" href="javascript:;" onclick="spaceDiy.setCurrentDiy('body');return false;">背景</a>
<span class="pipe">|</span><a id="diy_tag_blocktitle" href="javascript:;" onclick="spaceDiy.setCurrentDiy('blocktitle');return false;">标题栏</a></span>
<span class="pipe">|</span><a id="diy_tag_ct" href="javascript:;" onclick="spaceDiy.setCurrentDiy('ct');return false;">内容区</a>

  	<a style="margin-left: 40px;" id="bg_button" href="javascript:;" onclick="spaceDiy.hideBg();return false;">取消背景图</a>
<span class="pipe">|</span><a id="recover_button" href="javascript:;" onclick="spaceDiy.recoverStyle();return false;">恢复原装皮肤</a>
</dt>
<dd>
<div class="photo_list cl">
<div id="currentimgdiv" class="z" style="width:510px;">
<center><ul><li class="thumb" style="border:1px solid #ccc; padding:2px;"><img id="currentimg" alt="" src=""/></li></ul>
<div class="z" style="cursor:pointer" onclick="spaceDiy.changeBgImgDiv();">更换</div></center>
</div>
<div id="diyimages" class="z" style="width: 510px; display: none">
<div id="diyimg_prev" class="z"><?=$multi?></div>
<ul id="imagebody"><? if(is_array($list)) foreach($list as $key => $value) { ?><li class="thumb"><a href="javascript:;" onclick="return false;"><img src="<?=$value['pic']?>" alt="" onclick="spaceDiy.setBgImage(this);"/></a></li>
<? } ?>
</ul>
<div id="diyimg_next" class="z"><?=$multi?></div>
</div>
<div class="z" style="padding-left: 10px; width: 160px; border: solid #CCC; border-width: 0 1px;">
<table cellpadding="0" cellspacing="0">
<tr>
<td><label for="repeat_mode">图片平铺:</label></td>
<td>
<select id="repeat_mode" name="repeat_mode" onclick="spaceDiy.setBgRepeat(this.value);">
<option value="0" selected="selected">平铺</option>
<option value="1">直接使用</option>
<option value="2">横向平铺</option>
<option value="3">纵向平铺</option>
</select>
</td>
</tr>
<tr>
<td>图片位置:</td>
<td>
<table cellpadding="0" cellspacing="0" id="positiontable">
<tr>
<td id="bgimgposition0" onclick="spaceDiy.setBgPosition(this.id)">&nbsp;</td>
<td id="bgimgposition1" onclick="spaceDiy.setBgPosition(this.id)">&nbsp;</td>
<td id="bgimgposition2" onclick="spaceDiy.setBgPosition(this.id)">&nbsp;</td>
</tr>
<tr>
<td id="bgimgposition3" onclick="spaceDiy.setBgPosition(this.id)">&nbsp;</td>
<td id="bgimgposition4" onclick="spaceDiy.setBgPosition(this.id)">&nbsp;</td>
<td id="bgimgposition5" onclick="spaceDiy.setBgPosition(this.id)">&nbsp;</td>
</tr>
<tr>
<td id="bgimgposition6" onclick="spaceDiy.setBgPosition(this.id)">&nbsp;</td>
<td id="bgimgposition7" onclick="spaceDiy.setBgPosition(this.id)">&nbsp;</td>
<td id="bgimgposition8" onclick="spaceDiy.setBgPosition(this.id)">&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div class="z" style="padding-left: 10px; width: 180px;">
<table cellpadding="0" cellspacing="0">
<tr>
<td>背景滚动:</td>
<td>
<label for="rabga0"><input type="radio" id="rabga0" name="attachment_mode" onclick="spaceDiy.setBgAttachment(0);" class="pr" /> 滚动</label>
<label for="rabga1"><input type="radio" id="rabga1" name="attachment_mode" onclick="spaceDiy.setBgAttachment(1);" class="pr" /> 固定</label>
</td>
</tr>
<tr>
<td>背景颜色:</td>
<td><input type="text" id="colorValue" value="" size="6" onchange="window.parent.spaceDiy.setBgColor(this.value);" class="px vm" style="font-size: 12px; padding: 2px;" /><?php echo getcolorpalette('bpb', 'colorValue', 'white'); ?></td>
</tr>
</table>
</div>
<div class="z" style="padding-left: 10px; width: 180px;">
<table cellpadding="0" cellspacing="0">
<tr>
<td>文字颜色:</td>
<td><input type="text" id="textColorValue" value="" size="6" onchange="window.parent.spaceDiy.setTextColor(this.value);" class="px vm" style="font-size: 12px; padding: 2px;" /><?php echo getcolorpalette('tpb', 'textColorValue', 'white'); ?></td>
</tr>
<tr>
<td>链接颜色:</td>
<td><input type="text" id="linkColorValue" value="" size="6" onchange="window.parent.spaceDiy.setLinkColor(this.value);" class="px vm" style="font-size: 12px; padding: 2px;" /><?php echo getcolorpalette('lpb', 'linkColorValue', 'white'); ?></td>
</tr>
</table>
</div>
  </dd>
</dl>
<? } elseif($op == 'import') { ?>
<h3 class="flb">
<em id="return_<?=$_G['gp_handlekey']?>">导入框架</em>
<span>
<? if($_G['inajax']) { ?><a href="javascript:;" class="flbc" onclick="hideWindow('<?=$_G['gp_handlekey']?>');return false;" title="关闭">关闭</a><? } ?>
</span>
</h3>

<form name="frameimport" id="frameimport" enctype="multipart/form-data" method="post" autocomplete="off" action="portal.php?mod=portalcp&amp;ac=diy&amp;op=import" onsubmit="ajaxpost('frameimport','return_<?=$_G['gp_handlekey']?>','','onerror',$('frameimportbutton'));">
  <div class="c" style="width:420px;line-height:100px; overflow-y: auto; ">
文本文件的位置 <input type="file" id="importfile" name="importfile" style="margin: 5px;">
</div>
<div class="o pns">
<input type="hidden" name="handlekey" value="<?=$_G['gp_handlekey']?>" />
<input type="hidden" name="importsubmit" value="true" />
<input type="hidden" name="tpl" value="<?=$_GET['tpl']?>" />
<input type="hidden" name="formhash" value="<?=FORMHASH?>" />
<button type="submit" class="pn pnc" id="frameimportbutton"><strong>导入</strong></button>
</div>
</form>
<script type="text/javascript" reload="1">
function succeedhandle_<?=$_G['gp_handlekey']?> (url, message, values) {
if (values['status'] == '1') {
if (values['css']) spaceDiy.initDiyStyle(values['css']);

var areaArr = values['html'];
var dom = document.createElement("div");
for (var i in areaArr) {
var html = areaArr[i].replace(/\[script/g, '<script').replace(/\[\/script\]/g, '<\/script>');
var area = $(i) ? $(i) : $(drag.moveableArea[0]);
dom.innerHTML = html;
var arr = [];
for (var i=0, l=dom.childNodes.length; i < l; i++) {
arr.push(dom.childNodes[i]);
}
var one = '';
while(one = arr.pop()) {
Util.insertBefore(one,area.firstChild);
}
}
drag.initPosition();
drag.isChange = true;
drag.setClose();
var blocks = values['bids'].split(',');
drag.blockForceUpdateBatch(blocks);
}

hideWindow('<?=$_G['gp_handlekey']?>');
}
</script>
<? } include template('common/footer'); ?>